package leo.game.ui
{
	import flash.display.MovieClip;
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	
	import ghostcat.util.easing.TweenUtil;
	
	import leo.manager.McMannager;
	
	public class UILose extends Sprite
	{
		private static var _instance :UILose = null;
		/**
		 * 确定按钮 
		 */		
		private var btnOK :SimpleButton;
		public function UILose()
		{
			super();
			
			var mc :MovieClip = McMannager.instance.getMCByName("UI_Lose");
			this.addChild(mc);
			this.btnOK = mc.btnOK;
			this.btnOK.addEventListener(MouseEvent.CLICK,clickHandler);
		}
		
		private function clickHandler(event :MouseEvent):void
		{
			this.showUILose(1000,-300,200);
			UILevel.instance.showUILevel(1000,300,300);
			UIBottom.instance.showBottom(1000,0,650);
			UITop.instance.showUITop(1000,0,-60);
		}

		public static function get instance():UILose
		{
			if(_instance == null)
			{
				_instance = new UILose();
			}
			return _instance;
		}
		/**
		 * 显示输掉UI 
		 * @param duration
		 * @param tx
		 * @param ty
		 * 
		 */		
		public function showUILose(duration :int, tx : int, ty :int):void
		{
			TweenUtil.to(this,duration,{x : tx,y :ty});
		}

	}
}